from client.ApiClient import client
from config.dynamic_configuration import ConfigCenter


class ChatService:

    @classmethod
    def chat(cls, messages) -> str:
        completion = client.chat.completions.create(
            model=ConfigCenter.get_model(),
            messages=messages,
            temperature=0.3,
        )

        return completion.choices[0].message
